package br.com.locadoraweb.dao;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class Conexao {
	
	public static Connection getConexao() throws SQLException {
		try {
			Class.forName("com.mysql.jdbc.Driver");
			System.out.println("Conectado ao Banco");
			return DriverManager.getConnection(
					"jdbc:mysql://localhost:3306/locadora", "root", "");
		} catch (ClassNotFoundException Erro) {
			System.out.println("Erro ao conectar" + Erro);
			Erro.printStackTrace();			
			throw new SQLException(Erro.getMessage());
		}

	}
}
